package com.antwork.common.entity;

import java.util.List;

public class Pagination<T> {
	private int currentPage = -1;
	private int pageSize = 20;
	private int pageCount;
	private int totalCount;
	private List<T> result;

	public Pagination() {
	}

	public Pagination(int currentPage, int pageSize, int totalCount) {
		this.currentPage = currentPage;
		this.pageSize = pageSize;
		this.totalCount = totalCount;

		if ((totalCount < 0) || (pageSize <= 0))
			this.pageCount = 0;
		if (totalCount % pageSize == 0)
			this.pageCount = (totalCount / pageSize);
		else
			this.pageCount = (totalCount / pageSize + 1);
	}

	public Pagination(List<T> result) {
		this.result = result;
	}

	public int getCurrentPage() {
		return this.currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public int getPageSize() {
		return this.pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getPageCount() {
		return this.pageCount;
	}

	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}

	public int getTotalCount() {
		return this.totalCount;
	}

	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}

	public List<T> getResult() {
		return this.result;
	}

	public void setResult(List<T> result) {
		this.result = result;
	}
}